package org.qqcui.designpattern.patterns.chain;

/**
 * 院长
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/7 17:06
 **/
public class CollegeApprover extends Approver {
    public CollegeApprover(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getPrice() <= 10000) {
            System.out.println("请求编号id=" + request.getId() + "被" + this.name + "处理");
        } else {
            // 让下一个审批者处理
            nextApprover.processRequest(request);
        }
    }
}
